package com.kaifamiao.logs;

import java.util.logging.Logger;

public class Loong {

    private static final Logger logger = Logger.getGlobal();

    private static String school; // 类变量
    private String name; // 实例变量

    static {
        logger.info( "school = " + school );
        school = "小飞龙学院";
        logger.info( String.format( "school = %s", school ) );
    }

    {
        logger.info( String.format("name = %s", name ) );
        this.name = "敖广";
        logger.info( String.format("name = %s", name ) );
    }

    public Loong(){
        super();
        logger.info( "构造方法执行" );
    }

    public void fly(){
        logger.info( String.format("%s正在飞行", name ));
    }

    public static void main(String[] args) {
        System.err.println( "- ".repeat( 30 ) );
        Loong x = new Loong();
        x.fly();
        System.err.println( "- ".repeat( 30 ) );
        x = new Loong();
        x.fly();
    }
}
